package de.hsma.srn.view.components;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.FocusEvent;

import javax.swing.BorderFactory;
import javax.swing.JTextField;

public class TextField extends JTextField {
	/**
	 * UID
	 */
	private static final long serialVersionUID = -8335401041462204485L;

	public TextField() {
		super();
		this.setFont(new Font("Helvetica", Font.PLAIN, 12));
		this.setForeground(new Color(140, 180, 204));
		this.setBackground(new Color(255, 255, 255));
		this.setBorder(null);
		this.addFocusListener(new java.awt.event.FocusListener() {
			@Override
			public void focusGained(FocusEvent e) {
				setForeground(new Color(0, 0, 0));
				setBackground(new Color(225, 235, 242));
				setBorder(BorderFactory.createLineBorder(new Color(140, 180, 204)));
			}

			@Override
			public void focusLost(FocusEvent e) {
				setForeground(new Color(140, 180, 204));
				setBackground(new Color(255, 255, 255));
				setBorder(null);
			}
			
		});
	}
}
